package com.drug.mingkang.mapper;


import com.drug.mingkang.model.HqSupplier;
import com.drug.mingkang.model.vo.PurchaseMaterialVo;
import com.drug.mingkang.model.vo.PurchaseorderVo;
import com.drug.mingkang.model.HqPurchaseorder;
import com.drug.mingkang.model.vo.rawMaterialVo;

import java.util.List;
import java.util.Map;

/**
 * 原材料采购单(HqPurchaseorder)表数据库访问层
 *
 * @author wenchangjian
 * @since 2020-08-11 12:00:13
 */
public interface HqPurchaseorderMapper {

    /**
     * 通过ID查询单条数据
     *
     * @param purchaseId 主键
     * @return 实例对象
     */
    HqPurchaseorder queryById(String purchaseId);

    /**
     * 查询多条数据
     * @param purchaseorderVo
     * @return 对象列表
     */
    List<HqPurchaseorder> queryAllByLimit(PurchaseorderVo purchaseorderVo);


    /**
     * 通过实体作为筛选条件查询
     *
     * @param hqPurchaseorder 实例对象
     * @return 对象列表
     */
    List<HqPurchaseorder> queryAll(HqPurchaseorder hqPurchaseorder);

    /**
     * 新增数据
     *
     * @param hqPurchaseorder 实例对象
     * @return 影响行数
     */
    int insert(HqPurchaseorder hqPurchaseorder);

    /**
     * 修改数据
     *
     * @param hqPurchaseorder 实例对象
     * @return 影响行数
     */
    int update(HqPurchaseorder hqPurchaseorder);

    /**
     * 通过主键删除数据
     *
     * @param purchaseId 主键
     * @return 影响行数
     */
    int deleteById(String purchaseId);

    int selectCount(PurchaseorderVo purchaseorderVo);

    List<rawMaterialVo> rawMaterialShowAllByLimit(rawMaterialVo rawMaterialVo);

    int rawMaterialselectCount(rawMaterialVo rawMaterialVo);

    List<Object> showTypeName();

    List<HqSupplier> showSupName();

    List<PurchaseMaterialVo> selectMaterial(PurchaseMaterialVo purchaseMaterialVo);

    HqPurchaseorder selectRemarkOperator(String purchaseId);

    boolean updatePurchaseSumprice(String purchaseId, double purchaseSumprice);

    boolean updatePurchaseorder(String remark, String supName, String purchaseId,double money);

    int selectMaterialCount(PurchaseMaterialVo purchaseMaterialVo);

    PurchaseMaterialVo selectPurchaseRemarkSupId(PurchaseMaterialVo purchaseMaterialVo);

    List<HqPurchaseorder> queryReviewByLimit(PurchaseorderVo purchaseorderVo);

    int selectReviewCount(PurchaseorderVo purchaseorderVo);

    boolean updateisva(String purchaseId , int state);

    /**
     * 原材料审核
     * @param purchaseorderVo 实例对象vo
     * @return
     */
    List<PurchaseorderVo> queryAuditAllByLimit(PurchaseorderVo purchaseorderVo);

    /**
     * 原材料审核总条数
     * @param purchaseorderVo 实例对象vo
     * @return
     */
    int count(PurchaseorderVo purchaseorderVo);

    boolean insertJoinTheInventory(String purchaseId);


    Map<String,Object> selectPurchaseMoneyAndRemark(String purchaseId);
}